<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/6/27
 * Time: 20:44
 */

$ch = curl_init();
$url = "http://www.cnblogs.com/hellohell/p/5718319.html";
curl_setopt($ch, CURLOPT_URL, $url);
//curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt( $ch, CURLOPT_HEADER, false);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$return = curl_exec( $ch );
curl_close( $ch );
//echo $return;
$regex="/<div id=\"cnblogs_post_body\">.*?<\/div>/si";

preg_match($regex,$return,$result);
echo($result[0]);
if(preg_match_all($regex, $return, $matches)){
	print_r($matches);
}else{
	echo '0';
}